import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    children: [
      //==============SKU管理模块===============
      {
        path: '/sys-admin/product/spu-management',
        component: () => import('../views/sys-admin/product/SpuManagement.vue')
      },
      {
        path: '/sys-admin/product/spu-management/sku-list',
        component: () => import('../views/sys-admin/product/SkuListView.vue')
      },
      //==============新增SPU===============
      {
        path: '/sys-admin/product/spu/add-new1',
        component: () => import('../views/sys-admin/product/SpuAddNewView1.vue')
      },
      {
        path: '/sys-admin/product/spu/add-new2',
        component: () => import('../views/sys-admin/product/SpuAddNewView2.vue')
      }
      ,
      {
        path: '/sys-admin/product/spu/add-new3',
        component: () => import('../views/sys-admin/product/SpuAddNewView3.vue')
      }
      ,
      {
        path: '/sys-admin/product/spu/add-new4',
        component: () => import('../views/sys-admin/product/SpuAddNewView4.vue')
      }
      ,
      //==============相册管理===============
      {
        path: '/sys-admin/product/album/add-new',
        component: () => import('../views/sys-admin/product/AlbumAddNewView.vue')
      },
      {
        path: '/sys-admin/product/album',
        component: () => import('../views/sys-admin/product/AlbumListView.vue')
      }
      ,
      {
        path: '/sys-admin/product/album/picture-list',
        component: () => import('../views/sys-admin/product/AlbumPictureListView.vue')
      },
      //==============分类管理===============
      {
        path: '/sys-admin/product/category',
        component: () => import('../views/sys-admin/product/CategoryListView.vue')
      }
      ,

      //==============属性模板管理===============
      {
        path: '/sys-admin/product/attributeTemplate',
        component: () => import('../views/sys-admin/product/AttributeTemplateListView.vue')
      }
      ,
      {
        path: '/sys-admin/product/attributeTemplate/add-new',
        component: () => import('../views/sys-admin/product/AttributeTemplateAddNewView.vue')
      },

      //==============属性管理===============
      {
        path: '/sys-admin/product/attribute',
        component: () => import('../views/sys-admin/product/AttributeListView.vue')
      },
      {
        path: '/sys-admin/product/attribute/add-new',
        component: () => import('../views/sys-admin/product/AttributeAddNewView.vue')
      },

      //==============品牌管理===============
      {
        path: '/sys-admin/product/brand',
        component: () => import('../views/sys-admin/product/BrandListView.vue')
      }
      ,
      {
        path: '/sys-admin/product/brand/add-new',
        component: () => import('../views/sys-admin/product/BrandAddNewView.vue')
      },

      //==============管理员管理===============
      {
        path: '/sys-admin/permission/admin',
        component: () => import('../views/sys-admin/permission/AdminListView.vue')
      }
      ,
      {
        path: '/sys-admin/permission/admin/add-new',
        component: () => import('../views/sys-admin/permission/AdminAddNewView.vue')
      }
    ]
  },
  {
    path: '/about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
